﻿using System;
using GDIT.BLL;
using GDIT.Model;
using GDIT.Base.PageBaseHelper;

namespace GDIT.page.manage
{
    public partial class login1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        private BUsers user = null;

        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            user = new BUsers();
            try
            {
                bool result = user.IsLogin(this.txtUserName.Text.Trim(), this.txtPwd.Text.Trim());
                if (result == true)
                {
                    Session["UserName"] = this.txtUserName.Text.Trim();
                    PageBase.MessageBoxShowAndGo("欢迎登陆广科后台管理系统！", "main.aspx", Page);
                }
                else
                {
                    PageBase.MessageBoxShow("登陆信息错误，请仔细核对登陆信息！", Page);
                }
            }
            catch (Exception ex)
            {
                PageBase.MessageBoxShow("操作失败，原因：" + ex.Message.ToString(), Page);
            }
        }
    }
}